﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public static Dictionary<string, string> userd = new Dictionary<string, string>();

        private void Form1_Load(object sender, EventArgs e)
        {
            userd.Add("adcd", "1234");

        }

        private void button1_Click(object sender, EventArgs e)
        {

            var userName = textBox1.Text;
            var userPwd = textBox2.Text;

            var res = userd.Where(x => x.Key == userName).FirstOrDefault();

            if(res.Key==userName&&res.Value==userPwd)
            {
                MessageBox.Show("恭喜你，登录成功。","登录成功");

            }
            else
            {
                MessageBox.Show("您的账号密码有误，或重新注册","登录失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            var b = new Form2();
            b.Show();
        }
        
    }
}
